﻿@model IEnumerable<BB.Apostas.Models.Classificacao>
<script src="../../Code/Classificacao.js" type="text/javascript"></script>
<h2>Classificacao</h2>
@if (Model != null)
{
    <h4>Competicao Activa: <strong>@ViewBag.Active</strong>
    </h4>
    if (ViewBag.Jornadas != null)
    {
    <div class="login_settings">
        <p>
            <label>
                Jornada:</label>
            @Html.DropDownList("Jornadas", "<< Seleccione uma jornada >>")
        </p>
    </div>
    }  
    <table id="tblRank">
        <caption>Classificacao</caption>
        <thead>
            <tr>
                <th scope="col">Posicao:</th>
                <th scope="col">Nome:</th>
                <th scope="col">Vitorias:
                </th>
                <th scope="col">Empates:
                </th>
                <th scope="col">Derrotas:
                </th>
                <th scope="col">GM:
                </th>
                <th scope="col">GS:
                </th>
                <th scope="col">Pontos:
                </th>
            </tr>
        </thead>
        <tbody>
            @{           
    int i = 0;
    foreach (var item in Model)
    {
                <tr>
                    <th scope="row">@(i + 1)</th>
                    <td>
                        @Html.DisplayFor(modelitem => item.User.UserName)
                    </td>
                    <td>
                        @Html.DisplayFor(modelitem => item.W)
                    </td>
                    <td>
                        @Html.DisplayFor(modelitem => item.D)
                    </td>
                    <td>
                        @Html.DisplayFor(modelitem => item.L)
                    </td>
                    <td>
                        @Html.DisplayFor(modelitem => item.GF)
                    </td>
                    <td>
                        @Html.DisplayFor(modelitem => item.GA)
                    </td>
                    <td>
                        @Html.DisplayFor(modelitem => item.Score)
                    </td>
                </tr>		
        i++;
    }            
            }
        </tbody>
    </table>
}
else
{
    <h3>Nao ha competicoes activas.
    </h3>
}
